//package com.exceeddata.vcloud.common.config;
//import javax.sql.DataSource;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
//import org.springframework.boot.autoconfigure.quartz.QuartzDataSource;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.core.env.Environment;
//
//import com.zaxxer.hikari.HikariDataSource;
//
//@Configuration
//public class DataSourceConfig {
//	
//	@Autowired
//	private Environment environment;
//
//	@Bean
//    @Primary
//    @ConfigurationProperties(prefix = "spring.datasource")
//    public DataSourceProperties primaryDataSourceProperties() {
//        return new DataSourceProperties();
//    }
//	
//    @Primary
//	@Bean(name = "dataSource")
//    public DataSource dataSource() {
//    	DataSourceProperties primaryDataSourceProperties = primaryDataSourceProperties();
//        DataSource datasource = primaryDataSourceProperties.initializeDataSourceBuilder().type(HikariDataSource.class).build();
//        return datasource;
//    }
//
//    @QuartzDataSource
//    @Bean(name = "quartzDataSource")
//    public DataSource quartzDataSource() {
//    	String quartzDriver=environment.getProperty("spring.quartz.properties.org.quartz.dataSource.qzDS.driver");
//    	String quartzUrl=environment.getProperty("spring.quartz.properties.org.quartz.dataSource.qzDS.URL");
//    	String quartzUser=environment.getProperty("spring.quartz.properties.org.quartz.dataSource.qzDS.user");
//    	String quartzPassword=environment.getProperty("spring.quartz.properties.org.quartz.dataSource.qzDS.password");
//    	DataSourceProperties dataSourceProperties = new DataSourceProperties();
//    	dataSourceProperties.setDriverClassName(quartzDriver);
//    	dataSourceProperties.setUrl(quartzUrl);
//    	dataSourceProperties.setUsername(quartzUser);
//    	dataSourceProperties.setPassword(quartzPassword);
//        DataSource datasource = dataSourceProperties.initializeDataSourceBuilder().type(HikariDataSource.class).build();
//        return datasource;
//    }
//}